package com.dwxt.mall.controller;

import com.dwxt.common.base.BaseResult;
import com.dwxt.mall.service.OrderGraphService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/mall/order")
@RestController
public class OrderGraph {

    @Autowired
    private OrderGraphService orderGraphService;

    @RequestMapping("/selectOrderGraph")
    public BaseResult selectOrderGraph(Integer pageNum,Integer pageSize) {
        return orderGraphService.selectOrderGraph(pageNum,pageSize);
    }

    @RequestMapping("/selectOrderByProductId")
    public BaseResult selectOrderByProductId(Integer productId,Integer pageNum,Integer pageSize){
        return orderGraphService.selectOrderByProductId(productId,pageNum,pageSize);
    }

    @RequestMapping("/selectProductByKey")
    public BaseResult selectProductByKey(Integer productId){
        return orderGraphService.selectProductByKey(productId);
    }
}
